<template>
      <div class="app-content">
        <el-card class="box-card">
          ETH盈余: 111
        </el-card>
        <el-row>
        <el-table :data="ordersData" border style="width: 100%" max-height="500">
          <el-table-column fixed type="index" width="50"></el-table-column>
          <el-table-column prop="time" header-align="center" label="日期" width="160"></el-table-column>
          <el-table-column prop="symbol" header-align="center" label="交易对" width="65"></el-table-column>
          <el-table-column prop="type" header-align="center" label="方向" width="50"></el-table-column>
          <el-table-column prop="eth" header-align="center" label="ETH起" width="160"></el-table-column>
          <el-table-column prop="price" header-align="center" label="价格" width="160"></el-table-column>
          <el-table-column prop="mold" header-align="center" label="类型" width="50"></el-table-column>
          <el-table-column fixed="right" header-align="center" label="操作">
            <template slot-scope="scope">
              <el-button type="text" size="small">取消订单</el-button>
            </template>
          </el-table-column>
        </el-table>
        </el-row>

        <el-dialog title="详情修改" :modal="false" :modal-append-to-body="true" :append-to-body="true" :lock-scroll="true" :fullscreen="true" :visible.sync="dialogEditFormVisible">
          <el-form :model="curEditForm" v-loading="fullscreenLoading" element-loading-text="拼命保存中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
          <el-form-item label="日期" >
             <el-date-picker v-model="curEditForm.time" style="float:left" type="datetime" placeholder="选择日期时间"></el-date-picker>
          </el-form-item>
            <el-form-item label="标题">
              <el-input v-model="curEditForm.title" auto-complete="off"></el-input>
            </el-form-item>
            <el-form-item label="简介">
              <el-input type="textarea" v-model="curEditForm.desc"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogEditFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="submitEditForm">确 定</el-button>
          </div>
        </el-dialog>

      </div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'

export default {
  data () {
    return {
      pulldown: true,
      currentPage: 1,
      currentTotal: 10,
      ordersData: [{uniqid: '123', eth: 0.2, orderId: 999222, type: '买', mold: 'A', amount: 0.00002, price: 0.221, time: '2018-05-16 14:23:21', symbol: 'hteth'}, {orderId: 999222, type: '买', mold: 'A', amount: 0.00002, price: 0.221, time: '2018-05-16 14:23:21', symbol: 'hteth'}],
      currentDate: new Date(),
      dialogEditFormVisible: false,
      curEditForm: {
        title: '',
        desc: '',
        time: ''
      },
      fullscreenLoading: false
    }
  },
  methods: {
    ...mapActions({
      setBoxWidth: 'SetShareBoxWidth',
      setBoxTitle: 'SetShareBoxTitle',
      setBoxDesc: 'SetShareBoxDesc',
      setBoxTime: 'SetShareBoxTime',
      setBoxImg: 'SetShareBoxImg',
      toggleOverlay: 'ToggleOverlay',
      initUser: 'InitUser'
    }),
    backTop: function () {
      document.body.scrollTop = 0
      document.documentElement.scrollTop = 0
    },
    submitEditForm: function () {
      let that = this
      console.log(this.curEditForm.time.getTime())
      this.fullscreenLoading = true
      setTimeout(() => { that.fullscreenLoading = false }, 2000)
    }
  },
  computed: {
    ...mapGetters({
      isLogin: 'IsLogin'
    })
  },
  mounted: function () {
    this.initUser()
  }
}
</script>

<style>
</style>
